import React from 'react'
import ReactEChart from 'echarts-for-react';
export default function Column({ StyleData, title, data, br = false }) {
    const options = {
        title: { text: title },
        tooltip: { trigger: 'axis' },
        yAxis: [{ type: 'value', minInterval: 1 }], // minInterVal  展示整数
        xAxis: [
            {
                type: 'category',
                data: data.xData,
                axisLabel: {
                    interval: 0,
                    formatter: (value) => (br ? value.split('').join('\n') : value),
                },
            },
        ],
        series: [
            {
                name: '人数',
                type: 'bar',
                data: data.yData,
                label: {
                    show: true,
                    precision: 1,
                    position: 'top',
                    valueAnimation: true,
                },
            },
        ],
    };
    return (
        <div className='staff-amount-container' style={StyleData}>
            <ReactEChart className="react_for_echarts" option={options}></ReactEChart>
        </div>
    )
}
